<template>
  <div class="notification-container">
    <!-- 绿色成功类提示 -->
    <div v-if="showSuccess" class="notification-banner success">
      <div class="notification-content">
        <el-icon class="notification-icon">
          <CircleCheckFilled />
        </el-icon>
        <span class="notification-text">系统使用方法</span>
        <!-- <a href="#" class="notification-link" @click.prevent="handleMethodClick">点击查看</a> -->
          <a href="https://docs.qq.com/doc/DZkxxd1J6U25tRkp0" target="_blank" class="notification-link">点击查看</a>
      </div>
      <el-button 
        type="text" 
        class="close-btn" 
        @click="showSuccess = false"
        :icon="Close"
        size="small"
      />
    </div>
    
    <!-- 蓝色信息类提示 -->
    <div v-if="showInfo" class="notification-banner info">
      <div class="notification-content">
        <el-icon class="notification-icon">
          <InfoFilled />
        </el-icon>
        <span class="notification-text">如有问题或建议，请联系：</span>
           <a href="https://github.com/GonewtwLyb" target="_blank" class="notification-link">@小林同学</a>
      </div>
      <el-button 
        type="text" 
        class="close-btn" 
        @click="showInfo = false"
        :icon="Close"
        size="small"
      />
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { CircleCheckFilled, InfoFilled, Close } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'

// 控制提示显示状态
const showSuccess = ref(true)
const showInfo = ref(true)

// 处理使用方法点击
const handleMethodClick = () => {
  ElMessage.info('使用方法详情功能开发中...')
}

// 每次访问页面时都显示提示信息
onMounted(() => {
  showSuccess.value = true
  showInfo.value = true
})
</script>

<style scoped>
.notification-container {
  margin-bottom: 16px;
}

.notification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.notification-banner:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.notification-banner.success {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}

.notification-banner.info {
  background-color: #f0f9ff;
  border: 1px solid #91d5ff;
  color: #1677ff;
}

.notification-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.notification-icon {
  margin-right: 8px;
  font-size: 16px;
}

.notification-text {
  margin-right: 8px;
  color: inherit;
}

.notification-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 500;
  margin-left: 4px;
}

.notification-link:hover {
  text-decoration: none;
  opacity: 0.8;
}

.close-btn {
  color: inherit !important;
  opacity: 0.6;
  margin-left: 12px;
  padding: 4px !important;
  min-height: auto !important;
  width: 24px !important;
  height: 24px !important;
}

.close-btn:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.04) !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .notification-container {
  margin-top: 16px;
}
  .notification-banner {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .notification-icon {
    font-size: 14px;
    margin-right: 6px;
  }
  
  .close-btn {
    width: 20px !important;
    height: 20px !important;
    margin-left: 8px;
  }
  
  .notification-text {
    line-height: 1.4;
  }
}

/* 确保在小屏幕上文字换行 */
@media (max-width: 480px) {
  .notification-content {
    /* flex-direction: column; */
    align-items: flex-start;
    gap: 4px;
  }
  
  .notification-banner {
    align-items: flex-start;
    padding: 12px;
  }
  
  .close-btn {
    align-self: flex-end;
    margin-top: -4px;
  }
}
</style>
